/*
 * @Author: zhoujinlong 765637726@qq.com
 * @Date: 2024-03-26 08:58:46
 * @LastEditors: zhoujinlong 765637726@qq.com
 * @LastEditTime: 2024-05-06 08:53:57
 * @FilePath: \election-yd\src\preload\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { contextBridge ,ipcRenderer} from 'electron'
import { electronAPI } from '@electron-toolkit/preload'
import pool from '../main/mysql/pool'
// Custom APIs for renderer
const api = {}

// Use `contextBridge` APIs to expose Electron APIs to
// renderer only if context isolation is enabled, otherwise
// just add to the DOM global.
if (process.contextIsolated) {
  try {
    contextBridge.exposeInMainWorld('electron', electronAPI)
    contextBridge.exposeInMainWorld('api', api)
  } catch (error) {
    console.error(error)
  }
} else {
  // @ts-ignore (define in dts)
  window.electron = electronAPI 
  // @ts-ignore (define in dts)
  window.api = api

 



  console.log('preload window',window); 
  
}
